﻿using Microsoft.EntityFrameworkCore;
using TrafficWebApi.Data;

namespace TrafficWebApi.Respoitories.Interfaces
{
    // IRepository.cs
    public interface IRepository<TEntity> where TEntity : class
    {
        Task<TEntity?> GetByIdAsync(int id);
        Task<IEnumerable<TEntity>> GetAllAsync();
        Task AddAsync(TEntity entity);
        Task UpdateAsync(TEntity entity);
        Task DeleteAsync(int id);
        IQueryable<TEntity> Query();
    }
}
